#!/usr/bin/python
# -*- coding: utf-8 -*-

import Location, Role
from Location import *
from Role import *

class ObjectInfo:

    def __init__ (self, object_id, position, hs, vs):

        self._object_id = object_id
        self._position = position
        self._hs, self._vs = hs, vs

        self._locations = []
        self._roles = []

    def add_location (self, area, degree):
        self._locations.append(Location(area, degree))

    def add_role (self, role, degree):
        self._roles.append(Role(role, degree))

    def __str__ (self):
        
        aux = 'Obj: ' + self._object_id + ', Pos [' + str(self._position._x) + ', ' + str(self._position._y) + '] '
        aux += (' Hs: ' + str(self._hs) + ' Vs: ' + str(self._vs) + ' ')

        aux += ('[')        
        for loc in self._locations:
            aux += (loc._area + '::' + str(loc._degree) + ' ')
        aux += ('] ')

        aux += ('[')        
        for role in self._roles:
            aux += (role._name + '::' + str(role._degree) + ' ')
        aux += ('] ')

        return aux
